<template>
  <div class='list bc-white'>
    <ul>
      <li v-for="(item, index) in listData" :key="index" @click="showDetail(item,index)">
        <p><span>签到时间：{{item.time}}</span><span :class="'category'+item.category+' fr category'">{{item.category_name}}</span></p>
        <p v-show="item.category!=3"><span>课程名称：{{item.title}}</span></p>
        <p><span>未签到数/总人数：<span class="color-red">{{item.not_signin_num}}</span>/{{item.total_num}}</span></p>
        <p class="rate-box">
          <span>出勤率：{{item.rate}}%</span>
          <span>迟到：{{item.late_num}}</span>
          <span>请假：{{item.leave_num}}</span>
          <span>旷到：{{item.not_signin_num}}</span>
        </p>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  props:['listData','routerDetail'],
  components:{
  },
  name: "",
  data () {
    return {
    };
  },
   methods:{
     showDetail(item,index){
      //  if(this.routerDetail)this.routerDetail(item)
      sessionStorage.setItem("detailId",item.id)
      this.$router.push("/attendance/mysign/detail")
     }
  },
   created(){
  }
}
</script>
<style lang="scss" scoped>
.list{
  li{
    padding: 20px;
    box-sizing:border-box;
    border-bottom: 1px solid #ddd;
  }
  .rate-box{
    display: flex;
    justify-content: space-between;
    width: 90%;
  }
  li:nth-of-type(1){
    border-top: none!important;
    box-shadow: 0px -2px 2px 0px #ddd;
  }
  .category{
    padding: 0 10px;
    color: #fff;
    border-radius: 2px;
  }
  .category1{
    background: #91242f;
  }
  .category2{
    background: #9a537e;
  }
  .category3{
    background: #484268;
  }
  .category4{
    background: #a1845c;
  }
  .category5{
    background: #7c925e;
  }
}
</style>